package com.javaee.jie.mapper;

import com.javaee.jie.po.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    @Insert("INSERT INTO user(username, password, phone, emile) VALUES(#{username}, #{password}, #{phone}, #{emile})")
    void addUser(User user);


    @Select("SELECT * FROM user WHERE username=#{username}")
    User selectUser(String username);

    @Select("SELECT * FROM user ")
    List<User> selectUsers();



    @Delete("DELETE from user where username=#{username}")
    void delUser(String username);

}
